Skip to main content

Get Task

GET /day/task/:taskId​

Description​

Returns a single task if the authenticated viewer is allowed to access it.

Request Parameters​

Requires Authentication: true​

PATH PARAMS​

NameTypeRequiredDescription
taskIdstringYesMongoDB task ID.

Usage Example​

await axios.get(
"https://api.daykeeper.app/day/task/67d9c2b7cc9e4db02fca1028",
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
)

Success Response​

{
"message": "task fetched successfully",
"data": {
"_id": "67d9c2b7cc9e4db02fca1028",
"title": "Read 20 pages",
"daily": false
}
}

Error Response​

CodeDescription
400Invalid task ID
401Missing or invalid access token
404Task not found or not visible to the viewer
500Server error